var jwt = require('jsonwebtoken');

var secretKey = '2022Hackathon';

module.exports = function (userInfo) {
  return jwt.sign({id: userInfo._id, username: userInfo.username}, secretKey, {expiresIn: '48h'})
}